#include<iostream>
#include<vector>


class Solution {
public:
    int removeDuplicates(std::vector<int>& nums) {
        int k = 0;
        int tmp_value;
        for(size_t i = 0; i< nums.size(); i++){
            if(i == 0){
                tmp_value = nums[i];
                k++;
            }
            else{
                if(tmp_value != nums[i]){
                    tmp_value = nums[i];
                    nums[k] = nums[i];
                    k++;
                }
            }
        }
        return k;
    }
};

int main(int argc, char* argv[]){
    std::vector<int> nums = {0,0,1,1,1,2,2,3,3,4};
    Solution sol;
    int k = sol.removeDuplicates(nums);
    std::cout << "k: " << k << std::endl;
    
    return 0;
}